<?php
/**
 * Created by PhpStorm.
 * User: liJia
 * Date: 2020/4/23
 * Time: 18:53
 */

namespace app\api\controller;

use app\admin\model\Config as ConfigModel;

class Index extends Common
{
    public function __construct(){
        parent::__construct();
    }

    public function getToken(){
        $account = 'Vzan1477935558';
        $key = '45abbeeb9a9f484fa9bc1e8f5a19d98c';
        $signkey = md5($key . time());
        $url = 'https://openapi.vzan.com/api/v1/token/get_token';
        $data = [
            'account' => $account,
            'signkey' => $signkey,
            'timestamp' => time()
        ];
        $res = httpRequest($url, 'POST', $data);
        dump(json_decode($res,true));
    }


    /**
     * 关于我们
     * @return \think\response\Json
     */
    public function contactUs(){
        try{
            $info = ConfigModel::getCfgByModule("UPLOAD_IMG");
            unset($info['file']);
            return resJson(200,'ok',$info);
        }catch (\Exception $e){
            return resJson(0,'获取失败');
        }
    }


    public function getAccount(){
        $info = ConfigModel::getCfgByModule("SITE_SEO");
        unset($info['file']);
        return resJson(200,'ok',$info);
    }
}


